/**
 *******************************************************************************
 * @file  ev_hc32f4a0_lqfp176_wm8731.h
 * @brief This file contains all the functions prototypes for wm8731 of the
 *        board EV_F4A0_LQ176_V10.
 @verbatim
   Change Logs:
   Date             Author          Notes
   2020-06-12       yangjp          First version
   2021-01-25       wangmin         Replace PWC_FCG1_IIC1 with PWC_FCG1_I2C1
 @endverbatim
 *******************************************************************************
 * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved.
 *
 * This software component is licensed by HDSC under BSD 3-Clause license
 * (the "License"); You may not use this file except in compliance with the
 * License. You may obtain a copy of the License at:
 *                    opensource.org/licenses/BSD-3-Clause
 *
 *******************************************************************************
 */
#ifndef __EV_HC32F4A0_LQFP176_WM8731_H__
#define __EV_HC32F4A0_LQFP176_WM8731_H__

/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C"
{
#endif

/*******************************************************************************
 * Include files
 ******************************************************************************/
#include "hc32_ddl.h"

/**
 * @addtogroup BSP
 * @{
 */

/** @addtogroup EV_HC32F4A0_LQFP176
 * @{
 */

/** @addtogroup EV_HC32F4A0_LQFP176_WM8731 HC32F4A0 EVB LQFP176 WM8731
 * @{
 */

#if ((BSP_ON == BSP_WM8731_ENABLE) && \
     (BSP_EV_HC32F4A0_LQFP176 == BSP_EV_HC32F4A0))

/*******************************************************************************
 * Global type definitions ('typedef')
 ******************************************************************************/

/*******************************************************************************
 * Global pre-processor symbols/macros ('#define')
 ******************************************************************************/
#define WM8731_DEV_ADDR                 (0x1AU)
#define WM8731_DEV_WRITE                (0x00U)
#define WM8731_DEV_READ                 (0x01U)

/* WM8731 I2C define */
#define WM8731_I2C_UNIT                 (M4_I2C1)
#define WM8731_I2C_UNIT_CLK             (PWC_FCG1_I2C1)
#define WM8731_I2C_BAUDRATE             (200000UL)
#define WM8731_I2C_TIMEOUT              (10000UL)

#define WM8731_I2C_SCL_PORT             (GPIO_PORT_D)
#define WM8731_I2C_SCL_PIN              (GPIO_PIN_03)
#define WM8731_I2C_SCL_FUNC             (GPIO_FUNC_49_I2C1_SCL)

#define WM8731_I2C_SDA_PORT             (GPIO_PORT_F)
#define WM8731_I2C_SDA_PIN              (GPIO_PIN_10)
#define WM8731_I2C_SDA_FUNC             (GPIO_FUNC_48_I2C1_SDA)

/*******************************************************************************
 * Global variable definitions ('extern')
 ******************************************************************************/

/*******************************************************************************
  Global function prototypes (definition in C source)
 ******************************************************************************/

#endif /* BSP_EV_HC32F4A0_LQFP176/BSP_WM8731_ENABLE */

/**
 * @}
 */

/**
 * @}
 */

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif /* __EV_HC32F4A0_LQFP176_WM8731_H__ */

/*******************************************************************************
 * EOF (not truncated)
 ******************************************************************************/
